/*
 * CompanyData.h
 *
 *  Created on: Mar 25, 2014
 *      Author: alexander
 */

#ifndef COMPANYDATA_H_
#define COMPANYDATA_H_

#include <string>
#include <map>

#include "Poco/StringTokenizer.h"

#include "FinancialData.h"

class CompanyData
{
public:
	CompanyData (const std::string& ticker, const std::string& exchange, const std::string& name,
			double lastQuote, double marketCap, const std::string& sector, const std::string& industry,
			const std::string& summary, bool isValid);

	void showCompanyInfo() const;
	//void setIncomeStatement(int year, IncomeStatement&& is);
//	void setIncomeStatement(const std::map<std::string, std::map<std::string, float>>& is) { incomeStatement_ = is };
	void setBalanceSheet(std::map<std::string, std::map<std::string, float>>& bs);
	void setCashFlow(std::map<std::string, std::map<std::string, float>>& cf);
	void setFinancialRatios(std::map<std::string, std::map<std::string, float>>& fr);
	void setKeyStatistics(std::map<std::string, float>& ks);
	CompanyData(): lastQuote_(0), marketCap_(0), isValid_ (false) {};
	bool isValid() const
	{
		return isValid_;
	}
	void setValid(bool isValid)
	{
		isValid_ = isValid;
	}

	const std::string& getExchange() const {
		return exchange_;
	}

	void setIncomeStatement(
			const std::map<std::string, std::map<std::string, float> >& incomeStatement) { incomeStatement_ = incomeStatement; }

private:
	std::string ticker_;
	std::string exchange_;
	std::string name_;
	double lastQuote_;
	double marketCap_;
	std::string sector_;
	std::string industry_;
	std::string summaryQuote_;
	bool isValid_;

	std::map<std::string, std::map<std::string, float>> incomeStatement_;	// a[category[year]] = value
	std::map<std::string, std::map<std::string, float>> balanceSheet_;
	std::map<std::string, std::map<std::string, float>> cashFlow_;
	std::map<std::string, std::map<std::string, float>> finRatios_;
	std::map<std::string, float> keyStatistics_;
};

#endif /* COMPANYDATA_H_ */
